﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace WebDemo
{
    public partial class VirtualPathUtilityDemo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string virtualPath = "~/VirtualPathUtilityDemo.aspx";
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("ToAbsolute:{0}", VirtualPathUtility.ToAbsolute(virtualPath));
            sb.AppendLine("<br/>");
            sb.AppendFormat("ToAppRelative:{0}", VirtualPathUtility.ToAppRelative(virtualPath));
            
            sb.AppendLine("<br/>");
            //sb.Append(VirtualPathUtility.Combine("ssss", virtualPath));
            sb.AppendLine("<br/>");
            sb.AppendFormat("路径{0}", VirtualPathUtility.GetDirectory(virtualPath));
            sb.AppendLine("<br/>");
            
            //VirtualPathUtility.MakeRelative();
            //VirtualPathUtility.
            sb.AppendLine("<br/>AppDomainAppPath：");
            sb.AppendLine( HttpRuntime.AppDomainAppPath);

            sb.AppendLine("<br/>AppDomainAppVirtualPath：");
            sb.AppendLine(HttpRuntime.AppDomainAppVirtualPath);


            sb.AppendLine("<br/>Request.ApplicationPath：");
            sb.AppendLine(this.Request.ApplicationPath);


            this.Label1.Text = sb.ToString();
        }
    }
}